#!/usr/bin/python
# -*- coding: UTF-8 -*-

# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html

import scrapy


class ShoptrackingspiderItem(scrapy.Item):
    # define the fields for your item here like:
    # name = scrapy.Field()
    pass


class DhgateShopPage(scrapy.Item):
    name = scrapy.Field()
    num = scrapy.Field()
    pass


class DhgateShopItem(scrapy.Item):
    pass


class CategorieItem(scrapy.Item):
    # def __init__(self, name, url, categorie):
    #     self.url = url
    #     self.name = name
    #     self.categorie = categorie

    url = scrapy.Field()
    name = scrapy.Field()
    categorie = scrapy.Field()

    # is_parent = scrapy.Field()

    def obj_to_json(self):
        return {
            'url': self.url,
            "name": self.name,
            "categorie": self.categorie
        }


class MerchandiseItem(scrapy.Item):
    icon = scrapy.Field()
    name = scrapy.Field()
    categorie = scrapy.Field()
    # 价格
    price = scrapy.Field()
    # 成本价
    costprice = scrapy.Field()
    # 免费配送
    free_ship = scrapy.Field()
    # 卖家名
    seller_name = scrapy.Field()
    # 商铺URL
    shop_url = scrapy.Field()
    # 成交量
    orders = scrapy.Field()
    # 评级
    review_num = scrapy.Field()
    search_key = scrapy.Field()
    # 平台
    platform = scrapy.Field()
